import http from "@/utils/request";
// 获取购物车数据
function cartRequest(token){
  return http({
   method: "get",
   url: "/api/v1/shop_carts",
   data: {},
   headers:{token:token}
  })
}

// 加入购物车
function addlist(product,amount,price,token) {
    return http({
        method:'post',
      url: '/api/v1/shop_carts',
      data:{product,amount,price},
      headers:{token:token}
    });
  }


// 删除购物车
function dellist(id,token) {
  return http({
      method:'delete',
    url: '/api/v1/shop_carts/' + id,
    data:{},
    headers:{token:token}
  });
}

  export {cartRequest,addlist,dellist}